from django.conf.urls import patterns, url
from docker_engine import views

urlpatterns = patterns('',
	url(r'^dashboard/$', views.dashboard_view, name = 'dashboard'),
    
    # Task URLs
    url(r'^task/index/$', views.task_index_view, name = 'task_index'),
    url(r'^task/detail/(?P<task_name>[\w_]+)$', views.task_detail_view, name = 'task_detail'),
    url(r'^task/detail/(?P<task_name>[\w_]+)/(?P<stats_type>[\w_]+)$', views.task_ajax_stats, name = 'task_ajax_stats'),
    url(r'^task/new/$', views.task_new_view, name = 'task_new'),
    url(r'^task/create/$', views.task_create_view, name = 'task_create'),
    url(r'^task/delete/(?P<task_name>[\w_]+)$', views.task_delete_view, name = 'task_delete'),

    # Node URLs
    url(r'^node/index$', views.node_index_view, name = 'node_index'),
    url(r'^node/detail/(?P<node_name>([\w_]|[.]|[-])+)$', views.node_detail_view, name = 'node_detail'),
    url(r'^node/new/$', views.node_new_view, name = 'node_new'),
    url(r'^node/create/$', views.node_create_view, name = 'node_create'),
    url(r'^node/update/$', views.node_update_view, name = 'node_update'),
    url(r'^node/delete/(?P<node_name>([\w_]|[.]|[-])+)$', views.node_delete_view, name = 'node_delete'),

    # Application URLs
    url(r'^application/index$', views.application_index_view, name = 'application_index'),
    url(r'^application/detail/(?P<application_name>[\w_]+)$', views.application_detail_view, name = 'application_detail'),
    url(r'^application/new/$', views.application_new_view, name = 'application_new'),
    url(r'^application/create/$', views.application_create_view, name = 'application_create'),
    url(r'^application/update/$', views.application_update_view, name = 'application_update'),
    url(r'^application/delete/(?P<application_name>[\w_]+)$', views.application_delete_view, name = 'application_delete'),
    url(r'^application/definition/(?P<application_name>[\w_]+)$', views.application_definition_view, name = 'application_definition'),

    # Container URLs
    url(r'^container/index$', views.container_index_view, name = 'container_index'),
    url(r'^container/detail/(?P<container_name>[\w_]+)/$', views.container_detail_view, name = 'container_detail'),
    url(r'^container/detail/(?P<container_name>[\w_]+)/(?P<stats_type>[\w_]+)$', views.container_ajax_stats, name = 'container_ajax_stats'),
    url(r'^container/new/$', views.container_new_view, name = 'container_new'),
    url(r'^container/create/$', views.container_create_view, name = 'container_create'),
    url(r'^container/start/(?P<container_name>[\w_]+)/$', views.container_ajax_start, name = 'container_start'),
    url(r'^container/stop/(?P<container_name>[\w_]+)/$', views.container_ajax_stop, name = 'container_stop'),
    url(r'^container/delete/(?P<container_name>[\w_]+)/$', views.container_delete_view, name = 'container_delete'),

    # Image URLs
    url(r'^image/index/$', views.image_index_view, name = 'image_index'),
    url(r'^image/detail/(?P<image_name>[\w_]+)$', views.image_detail_view, name = 'image_detail'),
    url(r'^image/new/$', views.image_new_view, name = 'image_new'),
    url(r'^image/pull/$', views.image_pull_view, name = 'image_pull'),
    url(r'^image/import/$', views.image_import_view, name = 'image_import'),
    url(r'^image/build/$', views.image_build_view, name = 'image_build'),
    url(r'^image/delete/(?P<image_name>[\w_]+)/$', views.image_delete_view, name = 'image_delete'),
)
